/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sahd.logic.client;

/**
 *
 * @author romms
 */
public class ClientManager {
    /**
    private UserBean userBean;
    private UserDAO userDAO;


    public ClientManager(){
        userDAO = new UserDAO();
    }

    private boolean isClient(int userTypeId){
        if(userTypeId == UserTypes.CLIENT)return true;
        return false;
    }

    public boolean registerClient(UserBean userBean){
        try {
            if(isClient(userBean.getUserTypeId())){
                this.userBean = userBean;
                userDAO.insert(this.userBean);
                return true;
            }else{
                return false;
            }
        } catch (DAOException ex) {
            return false;
        }
    }

    public boolean deleteClient(int clientId){
        try {
            userDAO.delete("WHERE userId= " + clientId);
            return true;
        } catch (DAOException daoException) {
            daoException.printStackTrace();
            return false;
        }

    }

    public boolean clientAccountExists(UserBean userBean){
        try {
            userDAO.search("userId =" + userBean.getUserId() + "AND userAccountName= " + userBean.getUserAccountName() + "AND userAccountPassword= " + userBean.getUserAccountPassword());
            return true;
        } catch (DAOException daoException) {
            daoException.printStackTrace();
            return false;
        }
    }
    

**/
}
